//show hide input value
$(document).ready(function() {
       		$('input[type="text"]').focus(function() {
    		    if (this.value == this.defaultValue){ 
    		    	this.value = '';
				}
				if(this.value != this.defaultValue){
	    			this.select();
	    		}
    		});
    		$('input[type="text"]').blur(function() {
    		    if ($.trim(this.value) == ''){
			    	this.value = (this.defaultValue ? this.defaultValue : '');
				}
    		});
		});

//toggle visibilty of subscribe input
$(document).ready(function(){
 $("#subscribe").click(function(){
 $("#subs_input").slideToggle("slow");
 return false; });

//image tooltip
    $("ul li a").hover(
                function () { $(this).next("span").stop(true, true).delay(200).animate({ opacity: "show", top: "-50" }, "slow"); },
                function () { $(this).next("span").delay(100).animate({ opacity: "hide", top: "-60" }, "fast"); });

});

//main menu
$(function(){
			   
	var index = 0,temp='';
	$("#main_menu li a").click(function(event){
													 
		if($(this).parent("li").index("#main_menu li")==index)
			return;
													 
		index = $(this).parent("li").index("#main_menu li");
		$("#content>div").fadeOut('slow');
		$("#content>div:eq("+index+")").fadeIn('slow');
													 
		$("#main_menu li").not($(this).parent("li")).removeClass("active").addClass("inactive");
		$(this).parent("li").addClass("active");
													 
		event.preventDefault();
													 
	});
});